home *** CD-ROM | disk | FTP | other *** search
/ SuperHack / SuperHack CD.bin / CODING / GRAPHICS / DAKIT.ZIP / EGA.INC < prev    next >
Encoding:
Text File  |  1987-09-17  |  1.3 KB  |  43 lines

  1. ;---------------------------------------------------------------------------
  2. ;                 ega.mac
  3. ; This header file defines subroutines to do ega graphics from assembler.
  4. ;-----------------------------------------------------------------
  5.  
  6. ; EGA register equates
  7.  
  8. TS_INDEX       equ    3c4h        ; Time Sequencer Index 
  9. TS_MASK        equ    2            ;   --  Map Mask (Enables CPU writes)
  10. GDC_INDEX    equ    3ceh        ; Graphics Data Controller Index
  11. GDC_MODE    equ    5            ;   --  Mode Register
  12. GDC_RSEL    equ    4            ;   --  Read Map Select
  13. CRTC_INDEX    equ    3d4h        ; CRT Controller Index
  14. CRTC_OFFSET    equ    13h            ;   --  Offset Register
  15. CRTC_STARTH    equ    0ch            ;   --  High Byte of Start Address
  16. CRTC_STARTL    equ    0dh            ;   --    Low Byte of Start Adrress
  17. STATUS_REGISTER    equ    3dah    ; EGA status register
  18. VSYNC_MASK    equ    08h            ;   --  Vertical synch bit in status register
  19.  
  20. ;-------------------------------------------------------------------------
  21. ;    SETREG    macro to set internal register <reg> of chip with
  22. ;               index register at <index> to the value stored in AL
  23. ;-----------------------------------------------------------------
  24.  
  25. ;    push    dx
  26. ;    mov        dx,P1
  27. ;    mov        ah,al
  28. ;    mov        al,P2
  29. ;    out        dx,ax
  30. ;    pop        dx
  31.  
  32. SETREG macro P1, P2
  33.     push    dx
  34.     mov        dx,P1
  35.     mov        ah,al
  36.     mov        al,P2
  37.     out        dx,al
  38.     mov        al,ah
  39.     inc        dx
  40.     out        dx,al
  41.     pop        dx
  42.     endm
  43.